<?php

use yii\db\Migration;

class m160516_021226_admin_role_menu extends Migration
{
    public function up()
    {
			$sql1 = "
				CREATE TABLE IF NOT EXISTS `admin_role_menu` (
				  `id` int(15) NOT NULL AUTO_INCREMENT,
				  `menu_id` int(15) NOT NULL,
				  `role_id` int(15) NOT NULL,
				  `created_at` datetime DEFAULT NULL,
				  `updated_at` datetime DEFAULT NULL,
				  PRIMARY KEY (`id`)
				) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=66 ;
			";
		$this->execute($sql1);
		$sql2 = "
			INSERT INTO `admin_role_menu` (`id`, `menu_id`, `role_id`, `created_at`, `updated_at`) VALUES
			(4, 164, 4, '2016-01-16 11:19:15', '2016-01-16 11:19:15'),
			(33, 165, 12, '2016-01-16 12:05:01', '2016-01-16 12:05:01'),
			(34, 167, 12, '2016-01-16 12:05:01', '2016-01-16 12:05:01'),
			(36, 169, 12, '2016-01-16 12:05:01', '2016-01-16 12:05:01'),
			(37, 164, 12, '2016-01-16 12:05:01', '2016-01-16 12:05:01'),
			(38, 165, 4, '2016-01-16 14:46:17', '2016-01-16 14:46:17'),
			(39, 167, 4, '2016-01-16 14:46:17', '2016-01-16 14:46:17'),
			(41, 169, 4, '2016-01-16 14:46:17', '2016-01-16 14:46:17'),
			(43, 171, 4, '2016-01-16 14:46:17', '2016-01-16 14:46:17'),
			(46, 166, 4, '2016-01-16 17:47:30', '2016-01-16 17:47:30'),
			(49, 168, 4, '2016-01-18 12:16:49', '2016-01-18 12:16:49'),
			(50, 170, 4, '2016-01-18 12:16:49', '2016-01-18 12:16:49'),
			(51, 164, 13, '2016-01-21 14:12:09', '2016-01-21 14:12:09'),
			(52, 165, 13, '2016-01-21 14:12:09', '2016-01-21 14:12:09'),
			(53, 167, 13, '2016-01-21 14:12:09', '2016-01-21 14:12:09'),
			(54, 168, 13, '2016-01-21 14:12:09', '2016-01-21 14:12:09'),
			(55, 169, 13, '2016-01-21 14:12:09', '2016-01-21 14:12:09'),
			(56, 166, 13, '2016-01-21 14:12:09', '2016-01-21 14:12:09'),
			(57, 170, 13, '2016-01-21 14:12:09', '2016-01-21 14:12:09'),
			(58, 171, 13, '2016-01-21 14:12:09', '2016-01-21 14:12:09'),
			(64, 177, 4, '2016-07-11 21:17:46', '2016-07-11 21:17:46'),
			(65, 178, 4, '2016-07-11 21:17:46', '2016-07-11 21:17:46');
			";
		$this->execute($sql2);
    }

    public function down()
    {
        echo "m160516_021226_admin_role_menu cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
